package com.example.controller;

import com.example.common.Result;
import com.example.dto.UserDTO;
import com.example.entity.Dept;
import com.example.entity.UserEntity;
import com.example.service.DeptService;
import com.example.service.UserService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

//    @RequestMapping("/{id}")
//    public Object findPerson(@PathVariable Integer id) {

    /// /        return List.of("icon_1", "icon_2", "bg");{
//        return List.of("icon_1", "icon_2", "icon_3", "icon_4");
//    }
    @PostMapping
    public Object insertOne(@RequestBody UserDTO userDTO) {
        userService.insertOne(userDTO);
        return Result.success();
    }

    @PatchMapping("/{ids}")
    public Object updateMany(@PathVariable List<Integer> ids, @RequestBody UserDTO userDTO) {
        userService.updateMany(ids, userDTO);
        return Result.success();
    }
}

